<div class="dropdown page-header-right">
  <button class="page-header-btn" id="version-dropdown" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Version {{page.kong_version}}
    {% if page.kong_version == site.data.kong_latest.release %}<em>(latest)</em>{% endif %}
    <span class="caret"></span>
  </button>

  <ul class="versions-dropdown dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="version-dropdown">
    {% for ver in site.data.kong_versions %}
      <li {% if ver.release== page.kong_version %} class="active" {% endif %}>
        {% if ver.lua_doc %}
          <a href="/{{ver.release}}/lua-reference/">
            {{ver.release}}
            {% if ver.release == site.data.kong_latest.release %}(latest){% endif %}
          </a>
        {% else %}
          <span>Not available for {{ver.release}}</span>
        {% endif %}
      </li>
    {% endfor %}
  </ul>
</div>
